<template>
	<view>
		<view class="form">
			<view class="item">
				<text class="text">认证结果:</text>
				<input class="input" disabled v-model="authMsg" type="text" />
			</view>
			<view class="card-btn flex-space-between">
				
			</view>
			<view class="card-btn flex-space-between">
				<view class="button next" @click="refresh" v-if="type == 4">刷新</view>
				<view v-show="previousStepShow" class="button next" @click="backSubmit" v-if="type == 4">重新认证</view>
			</view>
		</view>
		<w-compress ref="wCompress2" />
	</view>
</template>

<script>
	import {
		informationQuery
	} from "_a/user";
	import uploadImgMixin from "@/mixins/uploadImg";
	import signSmsMixin from "@/mixins/signSms";
	
	export default {
		mixins: [uploadImgMixin,signSmsMixin],
		props: {
			type: {
				default: 4, //5:修改 4:添加
			},
			res: null
		},
		data() {
			return {
				// type: 4, //5:修改 4:添加
				authMsg: "",
				isVisible: true,
				previousStepShow: true
			};
		},
		created() {
			//this.getData();
		},
		methods: {
			async getData() {
				let auth_bind_status = this.$storage.getStore("auth_bind_status");
				if(auth_bind_status && auth_bind_status==1){
					this.authMsg = "终端已绑定";
					this.previousStepShow = false;
					return;
				}
				let auth_result = this.$storage.getStore("auth_result");
				//'审核状态：0-待提交,1-审核通过,2-审核拒绝,3-待审核,4-审核中',
				//审核状态中不能再提交
				if(auth_result.data.auditStatus && auth_result.data.auditStatus==1){
					this.previousStepShow = false;
				}
				if(auth_result.data.auditStatus && auth_result.data.auditStatus==2){
					//this.previousStepShow = false;
				}
				if(auth_result.data.auditStatus && auth_result.data.auditStatus==3){
					this.previousStepShow = false;
				}
				if(auth_result.data.auditStatus && auth_result.data.auditStatus==4){
					this.previousStepShow = false;
				}
				
				this.authMsg = auth_result.data.auditMsg;
				
			},
			backSubmit() {
				//this.$emit("backSubmit", 2);
				this.$emit("backSubmit", 0);
			},
			refresh(){
				location.reload();
			}
			
		},
	};
</script>

<style lang="scss">
	page {
		// padding: 20upx 0;
	}

	.image-box {
		display: flex;
		justify-content: space-between;
		background-color: #ffffff;
	}

	.img-upload {
		background-color: #ffffff;
		padding: R(30px);

		.top-tips {
			text-align: left;
			font-size: R(24px);
			color: #C7C7C7;
			padding-top: R(40px);
			margin-bottom: R(20px);

			.red {
				margin-left: R(10px);
				color: red;
			}
		}

		.box-image {
			background-color: #dfdfe8;
			border-radius: R(10px);
			padding: R(20px);
			width: R(280px);
			// height: R(250px);
			margin: 0 auto;
			position: relative;

			.bg-image {
				width: R(240px);
				height: R(120px);
				margin: 0 auto;
			}

			.add {
				width: R(88px);
				height: R(88px);
				background-color: #3bc3ff;
				border-radius: 50%;
				text-align: center;
				font-size: R(80);
				line-height: R(78px);
				color: #ffffff;
				position: absolute;
				top: 50%;
				left: 50%; //居中
				margin-left: R(-44px);
				margin-top: R(-44);
			}
		}

		.tips {
			text-align: center;
			margin: R(30px);
			font-size: R(25px);
			color: #1e1e20;
			font-weight: 400;
		}
	}

	.form {
		margin: R(30px) 0;

		.item {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 25upx 20upx;
			font-size: 28upx;
			font-weight: 400;
			color: #262626;
			background: #fff;

			.input {
				flex: 1;
				text-align: right;
				margin-left: auto;
				font-size: 28upx;
				color: #7d7d7d;
			}

			.sendCode {
				margin-left: 10upx;
			}
		}

		.next {
			margin: 40upx auto 0;
			width: 581upx;
			height: 80upx;
			line-height: 80upx;
			text-align: center;
			background: $themeColor;
			border-radius: 10upx;
			font-size: 30upx;
			font-weight: 400;
			color: #ffffff;
		}

		.sub-tips {
			padding: 28upx 30upx;
			font-size: 26upx;
			font-weight: 400;
			color: #999999;
		}
	}

	.card-btn {
		.button {
			width: 45%;
			margin: R(30px);
			flex: 1;
		}
	}
</style>